package org.example.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @author Jandmla
 * Date: 2022/7/28
 * Time: 16:31
 * Description: 负载均衡策略配置类
 */
@Configuration
public class MySelfRule {
    @Bean
    public IRule myRule(){
        // 选择使用随机规则
        return new RandomRule();
    }
}